package com.example.administrator.dc.model;


import com.example.administrator.dc.Service.UserPhotoService;
import com.example.administrator.dc.Service.UserService;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;


/**
 * Created by Administrator on 2017/8/15.
 */

public class UsersModel {
    private Retrofit retrofit;
    public UsersModel(){
        retrofit=new Retrofit.Builder()
                .addConverterFactory(GsonConverterFactory.create())
                .baseUrl(Contants.BASE_URL1)
                .build();

    }
    //列表
    public Call userlist(){
        UserService service=retrofit.create(UserService.class);
        return  service.getuserlist();
    }
    public Call userphotolist(){
        UserPhotoService service=retrofit.create(UserPhotoService.class);
        return  service.getuserphotolist();
    }
    public Call userinfo(String userid)
    {
        UserService service=retrofit.create(UserService.class);
        return service.usermessage(userid);
    }
    //修改性别
    public Call editgender(String userid,String gender)
    {
        UserService service=retrofit.create(UserService.class);
        return service.editgender(userid,gender);
    }

    //修改性别
    public Call editusername(String userid,String name)
    {
        UserService service=retrofit.create(UserService.class);
        return service.editname(userid,name);
    }
    //修改学校
    public Call editSchool(String userid,String school)
    {
        UserService service=retrofit.create(UserService.class);
        return service.editschool(userid,school);
    }
}
